home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Garbo
/
Garbo.cdr
/
mac
/
source
/
music4c.sit
/
Music4C Folder
/
Sources Folder
/
MacInterface1.c
< prev
next >
Wrap
Text File
|
1990-06-08
|
3KB
|
119 lines
/*
* ⌐ Graeme Gerrard 1990
* Faculty of Music, University of Melbourne
* Parkville Victoria 3052 Australia.
*
* ARPANET: grae@murdu.ucs.unimelb.edu.au
* telephone: (613) 344 4127, Fax: (613) 344 5346
*/
#include "Music4C.h"
#include "Music4C_Prototype.h"
void MAC_do_pass12(void);
static pascal char MyFilter (DialogPtr theDialog, EventRecord *theEvent, short *itemHit);
static void Refresh_Dialog(DialogPtr GetSelection);
extern void prepare_score(void);
Boolean MAC_Check_Pass12_Events(int, int);
extern OSErr theErr;
extern Str255 theMess1;
CursHandle theCursor;
static Handle aHandA, aHandB;
static Handle aHand;
static DialogPtr GetSelection;
#define CANCELButton 1
/* ======================================================== */
/* This is an update routine for non-controls in the dialog */
/* This is executed after the dialog is uncovered by an alert */
static void Refresh_Dialog(GetSelection)
DialogPtr GetSelection;
{
Rect tempRect;
short DType;
Handle DItem;
GetDItem(GetSelection, CANCELButton, &DType, &DItem, &tempRect);
PenSize(3, 3);
InsetRect(&tempRect, -4, -4);
FrameRoundRect(&tempRect, 16, 16);
PenSize(1, 1);
}
/* ======================================================== */
void MAC_do_pass12()
{
Rect tempRect, box;
short DType;
GetSelection = GetNewDialog(PASS1_2_DIALOG, NIL, (WindowPtr)-1);
if ( ( theErr = ResError()) != noErr ) {
PstringCopy((char *)theMess1, "\MAC_do_pass12: Can't open dialog resource");
OSError(theMess1, NIL, theErr);
}
tempRect.top = GetSelection->portRect.top;
tempRect.left = GetSelection->portRect.left;
tempRect.bottom = GetSelection->portRect.bottom;
tempRect.right = GetSelection->portRect.right;
tempRect.top = ((screenBits.bounds.bottom - screenBits.bounds.top) - (tempRect.bottom - tempRect.top)) / 2;
tempRect.left = ((screenBits.bounds.right - screenBits.bounds.left) - (tempRect.right - tempRect.left)) / 2;
MoveWindow(GetSelection, tempRect.left, tempRect.top, TRUE);
ParamText("\p", NIL, NIL, NIL);
ShowWindow(GetSelection);
SelectWindow(GetSelection);
SetPort(GetSelection);
/* Setup initial conditions */
DrawDialog(GetSelection);
GetDItem(GetSelection, 2, &DType, &aHandA, &box);
GetDItem(GetSelection, 4, &DType, &aHandB, &box);
theCursor = GetCursor(watchCursor);
SetCursor(*theCursor);
prepare_score();
DisposDialog(GetSelection);
InitCursor();
}
Boolean MAC_Check_Pass12_Events(whichPass, SectionNo)
int whichPass;
int SectionNo;
{
EventRecord event;
long Number;
char theString[256];
WindowPtr windowp;
long aLong;
char c;
short itemHit;
if ( whichPass == 1 )
SetIText(aHandA, "\pPass1");
else if ( whichPass == 2 )
SetIText(aHandA, "\pPass2");
Number = (long)SectionNo;
NumToString(Number, theString);
SetIText(aHandB, theString);
GetNextEvent(everyEvent, &event);
if ( IsDialogEvent(&event) ) {
if ( DialogSelect(&event, &GetSelection, &itemHit)) {
if ( itemHit == CANCELButton) {
return(FALSE);
}
}
}
}